package og.example.views;
import og.example.dao.GroupDataProvider;
import og.example.entity.Group;
import og.example.entity.Student;
import og.example.dao.StudentDataProvider;
import og.example.views.MainFrame;
import javax.swing.*;
import javax.swing.*;
import java.awt.*;

public class CallFrame extends JFrame {
    public CallFrame(String message) {
        setTitle("随机选择结果");
        setSize(300, 200);
        setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        setLocationRelativeTo(null);

        JLabel messageLabel = new JLabel(message, SwingConstants.CENTER);
        JScrollPane scrollPane = new JScrollPane(messageLabel);

        getContentPane().setLayout(new BorderLayout());
        getContentPane().add(scrollPane, BorderLayout.CENTER);

        JButton okButton = new JButton("确定");
        getContentPane().add(okButton, BorderLayout.SOUTH);

        okButton.addActionListener(e -> dispose());

        setVisible(true);
    }
}